#if !defined(AFX_GCIS_H__880F13BB_E936_4A6F_AE31_D5E737309043__INCLUDED_)
#define AFX_GCIS_H__880F13BB_E936_4A6F_AE31_D5E737309043__INCLUDED_



#include "resource.h"




///////////////////////////////////////
//CBinaryHtmlStream
class CBinaryHtmlStream : public CHtmlStream
{
public:
	// we have a special overload of << to allow for a single byte
	CBinaryHtmlStream& operator<<(BYTE b) { Write(&b, 1); return *this; }
};



//////////////////////////////////////////////
//CGCISExtension
class CGCISExtension : public CHttpServer
{
	CString m_strPagePart0;

	CString m_strPagePart1;
	CString m_strPagePart2;
	CString m_strPagePart3;
	CString m_sFile;
CString m_localdir;

public:
	CGCISExtension();
	~CGCISExtension();

	//{{AFX_VIRTUAL(CGCISExtension)
	public:
	virtual BOOL GetExtensionVersion(HSE_VERSION_INFO* pVer);

	virtual void EndContent(CHttpServerContext* pCtxt) const;
	virtual CHtmlStream* ConstructStream();
	virtual LPCTSTR GetTitle() const;
	virtual BOOL OnParseError(CHttpServerContext* pCtxt, int nCause);
	virtual void StartContent(CHttpServerContext* pCtxt) const;
	virtual DWORD HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB);
	virtual void WriteTitle(CHttpServerContext* pCtxt) const;
	
	
	//}}AFX_VIRTUAL

	virtual BOOL TerminateExtension(DWORD dwFlags);

	void Default(CHttpServerContext* pCtxt);
	void gcl(CHttpServerContext* pCtxt,  char* sFile );
	void chart(CHttpServerContext* pCtxt, char* sFile );
	
	void GetImage(CHttpServerContext* pCtxt);
	
	
	DECLARE_PARSE_MAP()
		
		//{{AFX_MSG(CGCISExtension)
		//}}AFX_MSG
	
	
	
	private:
		BOOL LoadLongResource(CString& str, UINT nID);
		void OutputJpeg(CHttpServerContext* pCtxt, const CByteArray& data);
};


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GCIS_H__880F13BB_E936_4A6F_AE31_D5E737309043__INCLUDED)
